package com.rou.im.framework.core.cmd;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-04-26 21:58
 */
public class DefaultCmdRegistry implements CmdRegistry {

    private Map<Integer,CmdMeta> cmdMetaMap = new ConcurrentHashMap<>();

    @Override
    public void register(CmdMeta cmdMeta) {
        cmdMetaMap.put(cmdMeta.getCmdId(),cmdMeta);
    }

    @Override
    public CmdMeta get(Integer cmdId) {
        return cmdMetaMap.get(cmdId);
    }
}
